package com.base.myproject.server;

public class UserPool {
	  static UserPool userpool;
	    java.util.Hashtable<String,User> ht = new java.util.Hashtable<String,User>();
	    private UserPool(){
	        
	    }
	    public static UserPool getInstance()
	    {
	        if(userpool==null)
	            userpool=new UserPool();
	        
	        return userpool;
	        
	    }
	    public void addUser(String uuid,User user)
	    {
	    	// ht.put(user.getUserName(), user);
	    	ht.put(uuid, user);
	    }
	    public void removeuser(String uuid)
	    {
	    	if(ht.contains(uuid))
	    		ht.remove(uuid);
	    }
	    public User getUser(String uuid)
	    {
	    	return ht.get(uuid);
	    }
}
